package com.song.annotation;

import com.song.config.validation.EnumValidator;
import com.song.enums.BaseEnum;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Documented
@Constraint(validatedBy = {EnumValidator.class})
public @interface EnumValidate {
    String[] enums() default {};

    Class<? extends BaseEnum<?>> baseEnum();

    String message() default "非法枚举";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
